<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>[title]</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/Public/Admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min.css?v=4.1.0" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<script src="/Public/Admin/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<style>
	.form-group{
	margin-right:20px;
	margin-top: 5px;"
	}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-8">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>用户资金</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
					<div class="hr-line-dashed"></div>
                    <form class="form-horizontal m-t" id="insertForm" method="post" >
						<div class="form-group">
							<label class="col-sm-3 control-label">用户名:</label>
							<div class="input-group col-sm-4">
								<input id="shopName" type="text" value="<?php echo ($info['username']); ?>" disabled class="form-control" required="" aria-required="true">
							</div>
						</div>
						<?php if(is_array($currency)): $i = 0; $__LIST__ = $currency;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="form-group">
								<label class="col-sm-3 control-label"><?php echo ($vo['name']); ?>:</label>
								<div class="input-group col-sm-4">
									<input id="shopName" type="text" value="<?php echo ($money_info[$vo['id']]['num']); ?>" disabled class="form-control" name="shopName" required="" aria-required="true">
								</div>
							</div><?php endforeach; endif; else: echo "" ;endif; ?>
                    </form>
					<div class="ibox-title">
						<h5>修改用户资金</h5>
					</div>
					<form id='commentForm' role="form" method="get" class="form-horizontal m-t">
						<div class="form-group">
							<label class="col-sm-3 control-label">币种:</label>
							<div class="input-group col-sm-4">
								<select class="form-control" name="currency_id">
									<?php if(is_array($currency)): $i = 0; $__LIST__ = $currency;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option  value="<?php echo ($vo['id']); ?>"><?php echo ($vo['name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">类型:</label>
							<div class="input-group col-sm-4">
								<select class="form-control" name="type">
									<option  value="dec">扣除</option>
									<option  value="inc">增加</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">金额:</label>
							<div class="input-group col-sm-4">
								<input id="shopName" type="text" value="" class="form-control" name="num" required="" aria-required="true">
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-4 col-sm-offset-3">
                                <input value="<?php echo ($info['id']); ?>" class="form-control" name="user_id" type="hidden" required="" aria-required="true">
                                <button class="btn btn-primary" type="button" onclick="toVaild()">提交</button>
                            </div>
						</div>
                    </form>
                </div>
            </div>
            <div class="hr-line-dashed"></div>

        </div>
    </div>
</div>
<script src="/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/Admin/js/content.min.js?v=1.0.0"></script>
<script src="/Public/Admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/Public/Admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/Public/Admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/Public/Admin/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script src="/Public/Admin/js/plugins/layer/laydate/laydate.js"></script>
<script src="/Public/Admin/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="/Public/Admin/js/plugins/layer/layer.min.js"></script>
<link rel="stylesheet" href="/Public/Admin/js/plugins/zTree/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="/Public/Admin/js/plugins/zTree/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="/Public/Admin/js/plugins/zTree/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript" src="/Public/Admin/js/plugins/zTree/jquery.ztree.exedit-3.5.js"></script>
<!-- 查看图片 -->
<div id="lookPic" onclick="closePic()"  style="display:none">
	<div class="lookPic">
		<img id="picccc"  src="">
	</div>
</div>
<style>
#lookPic{
	position:absolute;
	left:0;
	top:0;
	z-index:100;
	height:100%;
	width:100%;
	/*background:black;
	opacity:1;
	filter:alpha(opacity=40)*/
}
.lookPic{
     background:#fff;  
	 position:absolute;    
	 left:50%;    
	 top:50%;   
	 margin-left:-0px;   
	 margin-top:-0px;
}
</style>
<script>
	//查看图片
	function lookPic(pic){
		$('#lookPic').show();
		$('#picccc').attr('src',pic);
	}
	//关闭图片
	 function closePic(){
		 $('#lookPic').hide();
			$('#picccc').attr('src','');
	}
</script>
<!-- 查看图片结束 -->
<script type="text/javascript">

    //表单提交
    function toVaild(){
        var jz;
        var url = "<?php echo U('UserMoney/changeMoneyFormSub');?>";
        $.ajax({
            type:"POST",
            url:url,
            data: $('#commentForm').serialize(),// 你的formid
            async: false,
            beforeSend:function(){
                jz = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            },
            error: function(request) {
                layer.close(jz);
                swal("网络错误!", "", "error");
            },
            success: function(data) {
                //关闭加载层
                layer.close(jz);
                if(data['status'] == true){
                    swal(data.info, "", "success");setTimeout("location.reload()",1000); 
                }else{
                    swal(data.info, "", "error");
                }

            }
        });

        return false;
    }

</script>
</body>
</html>